﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MBSPL.UserControls.MovieScheduleUserControl
{
    public partial class AddMovieScheduleUserControl : System.Web.UI.UserControl
    {
        Dictionary<int, string> cinemaDictionary;
        Dictionary<int, string> screenDictionary;

        MBSBLC.BLC blc;
        protected void Page_Load(object sender, EventArgs e)
        {
            MBSBLC.BLC blc = new MBSBLC.BLC();

            cinemaDictionary = blc.GetAllCinemas();
            cinemaDropDownList.DataSource = cinemaDictionary;
            cinemaDropDownList.DataTextField = "Value";
            cinemaDropDownList.DataValueField = "Key";

        }

        protected void movieDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void cinemaDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            MBSBLC.BLC blc = new MBSBLC.BLC();

            Console.WriteLine("cinemaDropDownList.SelectedValue = " + cinemaDropDownList.SelectedValue);
            /*
             screenDictionary = blc.GetAllScreensByCinemaID(cinemaDropDownList.SelectedValue);
             screenDropDownList.DataSource = screenDictionary;
             screenDropDownList.DataTextField = "Value";
             screenDropDownList.DataValueField = "Key";
       
             */
        }

        protected void screenDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void AddSchedule_Click(object sender, EventArgs e)
        {
            int MovieScheduleID = 1;
            DateTime StartDate = DateTime.Now;
            DateTime EndDate = DateTime.Now;
            DateTime ShowStartTime = DateTime.Now;
            DateTime ShowEndTime = DateTime.Now;
            double WeekDateFare = Convert.ToDouble(WeekdayFeeTextBox.Text);
            double WeekEndFare = Convert.ToDouble(WeekendFeeTextBox.Text);
            bool IsDeleted = false;
            int CinemaID = 1;
            int ScreenNo = 1;
            int MovieID = 1;
            blc = new MBSBLC.BLC();
            blc.AddMovieSchedule(
        StartDate,
        EndDate,
        ShowStartTime,
        ShowEndTime,
        WeekDateFare,
        WeekEndFare,
        IsDeleted,
       CinemaID,
        ScreenNo,
        MovieID);

        }
    }
}